home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Open Transport / OT1.1 Developer Release / Open Transport SDK / Open Tpt Module Developer / Includes / OpenTptPCISupport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-19  |  3.9 KB  |  123 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        OpenTptPCISupport.h
  3.  
  4.     Contains:    File to include everything you need to declare a module
  5.  
  6.     Copyright:    © 1993-1995 by Apple Computer, Inc., all rights reserved.
  7.  
  8.     Change History (most recent first):
  9.  
  10.          <3>     9/15/95    mjq        Make sure release disk includes Devices.h, not NewDevices.h
  11.          <2>     9/05/95    mjq        • Rename OpenTptDev.h to OpenTptCommon.h
  12.          <1>     7/31/95    mjq        • Started over from OpenTransport project
  13.  
  14.     To Do:
  15.  
  16. */
  17.  
  18. #ifndef __OPENTPTPCISUPPORT__
  19. #define __OPENTPTPCISUPPORT__
  20.  
  21. #ifndef __OPENTPTCOMMON__
  22. #include <OpenTptCommon.h>
  23. #endif
  24. #ifndef __DEVICES__    
  25. #include <NewDevices.h>            /* this line deleted for release disk */
  26. #if 0                            /* this line deleted for release disk */
  27. #include <Devices.h>
  28. #endif                            /* this line deleted for release disk */
  29. #endif
  30.  
  31. #if PRAGMA_ALIGN_SUPPORTED
  32. #pragma options align=mac68k
  33. #endif
  34.  
  35. /*******************************************************************************
  36. ** This is the cookie that is passed to your STREAM Module
  37. ********************************************************************************/
  38.  
  39. struct OTPCIInfo
  40. {
  41.     RegEntryID            fTheID;
  42.     void*                fConfigurationInfo;
  43.     size_t                fConfigurationLength;
  44. };
  45.  
  46. typedef struct OTPCIInfo OTPCIInfo;
  47.  
  48. /*******************************************************************************
  49. ** PCI Card support
  50. ********************************************************************************/
  51. /*
  52.  * All PCI card modules should have the following bits set in their
  53.  * install_info structure:
  54.  * kOTModIsDriver.
  55.  * 
  56.  * They should NEVER have the kOTModPushAlways or the kOTModIsModule
  57.  * flags set.
  58.  *
  59.  * The kOTModIsLowerMux bits should be set if the driver is a lower
  60.  * multiplexor, although Open Transport does nothing with the information
  61.  * today.
  62.  *
  63.  * The kOTModUpperIsDLPI bit should be set if the driver uses the DLPI message
  64.  * specification.  The kOTModUpperIsTPI bit should be set if the driver uses
  65.  * the TPI message specification.
  66.  */
  67.  
  68.  /*    -------------------------------------------------------------------------
  69.     Macro to put together the driverServices.service[x].serviceType field
  70.     
  71.     // xxxxxddd dddddddd ffffffff xxxxxxTD
  72.     //
  73.     // where "d" is the device type for Open Transport,
  74.     // the lower two bits are whether the driver is TPI or DLPI,
  75.     // and the "f" bits are the framing option flags.
  76.     // and all other bits should be 0
  77.     ------------------------------------------------------------------------- */
  78.  
  79. #define OTPCIServiceType(devType, framingFlags, isTPI, isDLPI)    \
  80.     ((devType << 16) | (((framingFlags) & 0xff) << 8) | (isTPI ? 2 : 0) | (isDLPI ? 1 : 0 ))
  81.  
  82.  /*    -------------------------------------------------------------------------
  83.     Typedef for the ValidateHardware function.  This function will be
  84.     called only once, at system boot time, before installing your driver
  85.     into the Open Transport module registry.
  86.     The param pointer will is a RegEntryIDPtr - don't be changing the
  87.     values there!
  88.     ------------------------------------------------------------------------- */
  89.  
  90. typedef OTResult    (* _CDECL ValidateHardwareProcPtr)(OTPCIInfo* param);
  91.  
  92. enum
  93. {
  94.     kOTPCINoErrorStayLoaded        = 1
  95. };
  96.  
  97. /*    -------------------------------------------------------------------------
  98.     Some descriptors we use - these should eventually show up
  99.     in system header files somewhere.
  100.     ------------------------------------------------------------------------- */
  101.  
  102. #define kDescriptorProperty        "driver-descriptor"
  103. #define kDriverProperty            "driver,AAPL,MacOS,PowerPC"
  104. #define kDriverPtrProperty        "driver-ptr"
  105. #define kSlotProperty            "AAPL,slot-name"
  106.  
  107. /*    -------------------------------------------------------------------------
  108.     Maximum # of services support by Open Transport.  If your module
  109.     exports more than this # of services, Open Transport will not be
  110.     able to use the module.
  111.     ------------------------------------------------------------------------- */
  112.  
  113. enum
  114. {
  115.     kMaxServices                = 20
  116. };
  117.  
  118. #if PRAGMA_ALIGN_SUPPORTED
  119. #pragma options align=reset
  120. #endif
  121.  
  122. #endif    /* __OPENTPTPCISUPPORT__ */
  123.